##import sys
##
##abc=sys.stdin.readline()
##
##sys.stdout.write("adada");
##
##print(abc)
##import time
##import random
##def print_0_to_n(n):
##     
##    start = time.time()
##    for i in range(0,n):
##        print (i)
##    end = time.time()
##    print ("程序运行了%s" %{end-start})
##
##
##print_0_to_n(1000)

##import time
##import random
##def print_0_to_n(n):
##     
##    start = time.time()
##    for i in range(0,n):
##        print (i)
##        time.sleep(1)
##    end = time.time()
##    print ("程序运行了%s" %{end-start})
##
##
##print_0_to_n(100)

##import pickle
##game_data = {"name":"zhagnsan","life":56,"fail":98}
##save_file = open("d:/work/python/lab10.dat","wb")
##pickle.dump(game_data, save_file)
##save_file.close()
##
##load_file = open("d:/work/python/lab10.dat","rb");
##load_game_data = pickle.load(load_file)
##load_file.close()
##print (load_game_data)

import turtle
t = turtle.Pen()
##for i  in range (0,4):
##    t.forward(50)
##    t.right(90)
##
##t.reset()
##for i  in range (8):
##    t.forward(50)
##    t.right(225)
##for i  in range (20):
##    t.forward(100)
##    t.right(95)
'''
t.color(0.9, 0.5,0)
t.begin_fill()
for i in range(0,4):
    if(i%2 == 0):
        t.forward(100)
    else:
        t.forward(30)
    t.right(90)
t.end_fill()

t.up();
t.forward(25)
t.down()
t.left(90)
t.begin_fill()
for i in range(0,4):
    if(i%2 == 0):
        t.forward(20)
    else:
        t.forward(50)
    t.right(90)
t.end_fill()

t.up();
t.right(180)
t.forward(30)
t.down()
t.color(0,0,1)

t.begin_fill()
for i  in range(0,18):
    t.forward(2)
    t.right(20);
t.end_fill()


t.up()
t.left(95)
t.forward(55)
t.down()
t.begin_fill()
for i  in range(0,20):
    t.forward(2)
    t.right(20);
t.end_fill()
'''
##def mysquare(size):
##    for i in range(0,4):
##        t.forward(size)
##        t.left(90)
##
##for i in range(1,5):
##    mysquare(i*20)

##def mycircle(red, green ,blue ,filled):
##    if(filled == True):
##        t.color(red,green,blue) 
##        t.begin_fill()
##    t.circle(20)
##
##    if(filled == True):
##        t.end_fill()
##
##for j in range(1,4):
##    print (j)
##    if(j==2):
##        mycircle(1,0,0,True)
##    else:        
##        mycircle(0,1,0,True)
##    t.up()
##    t.forward(10)
##    t.down()
'''
def mysquare(size, red, green, blue, filled):
    t.color(red, green, blue)
    if(filled == True):
        t.begin_fill()
    for i in range(0,4):
        t.forward(size)
        t.left(90)
    if(filled== True):
        t.end_fill()

for i in range(1,5):
    mysquare(i*20, 0.5, 0.1, 0.5, True)
'''
def mygraphic(size, tangle, red, green, blue, times,filled):
    if(filled == True):
        t.color(red, green, blue)
        t.begin_fill()
    for i  in range (0,times):
        t.forward(size)
        t.right(tangle)
    if(filled == True):
        t.end_fill()

mygraphic(100, 95, 0.2, 0.5,0.1, 20, True)

t.up()
t.forward(100)
mygraphic(100, 135, 0.3, 0.3,0.1, 20, True)

